﻿using System;

namespace MIXer.Core.Extensions
{
    public static class MIXerExtensions
    {
        #region Methods
        public static string RemoveIllegalChars(this string text, string[] illegalChars)
        {
            foreach (var ch in illegalChars)
            {
                if (text.Contains(ch))
                {
                    text = text.Replace(ch, String.Empty);
                }
            }

            return text;
        }
        public static string ToFriendlySize(this long size)
        {
            return String.Format(new FileSizeFormatProvider(), "{0:fs}", size);
        }
        public static string ToFriendlySpeed(this double speed)
        {
            return String.Format(new FileSizeFormatProvider(), "{0:fs}/s", speed);
        }
        #endregion
    }
}
